package com.xuelang.pipeline.domain.pipeline.service.imp;

import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.pipeline.dto.PipelineGroupQuery;
import com.xuelang.pipeline.domain.pipeline.PipelineGroup;
import com.xuelang.pipeline.domain.pipeline.repository.PipelineGroupRepository;
import com.xuelang.pipeline.domain.pipeline.service.PipelineGroupDomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 流水线分组领域服务实现类
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Service
public class PipelineGroupDomainServiceImpl implements PipelineGroupDomainService {

    @Autowired
    private PipelineGroupRepository pipelineGroupRepository;

    @Override
    public PageRecord<PipelineGroup> pageList(long currentPage, long pageSize, PipelineGroup pipelineGroup) {
        return pipelineGroupRepository.pageList(currentPage, pageSize, pipelineGroup);
    }

    @Override
    public List<PipelineGroup> list(PipelineGroup pipelineGroup) {
        return pipelineGroupRepository.list(pipelineGroup);
    }


    @Override
    public Boolean save(PipelineGroup pipelineGroup) {
        return pipelineGroupRepository.save(pipelineGroup);
    }

    @Override
    public Boolean update(PipelineGroup pipelineGroup) {
        return pipelineGroupRepository.update(pipelineGroup);
    }

    @Override
    public Boolean delete(String uuid) {
        return pipelineGroupRepository.delete(uuid);
    }

    @Override
    public Boolean deleteByCondition(PipelineGroup condition) {
        return pipelineGroupRepository.deleteByCondition(condition);
    }

    @Override
    public PipelineGroup query(String uuid) {
        return pipelineGroupRepository.query(uuid);
    }

    @Override
    public List<PipelineGroup> queryByGroupUuid(String groupUuid) {
        return pipelineGroupRepository.queryByGroupUuid(groupUuid);
    }

    @Override
    public Boolean deleteByPipelineCode(String pipelineCode) {
        return pipelineGroupRepository.deleteByPipelineCode(pipelineCode);
    }

    @Override
    public Boolean modifyPipelineGroups(PipelineGroupQuery query, String creatorId) {
        return pipelineGroupRepository.modifyPipelineGroups(query, creatorId);
    }
}
